Fix closing of /var/log/xend.log fd
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Thu, 1 Sep 2005 10:26:17 +0000 (10:26 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Thu, 1 Sep 2005 10:26:17 +0000 (10:26 +0000)
Fix the problem where /var/log/xend.log was getting closed and then
/var/log/xend-debug was getting all the spam about the fd being closed
in the logging stuff.

Basically what was happening is that the main thread wasn't sticking
around and during its exit, the atexit handlers of the python logging
stuff got called closing the log fd.

Patch makes it so that we instead wait on the real server threads to
exit before shutting things down.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
tools/python/xen/xend/server/SrvServer.py

index 19106550b1c1a3dd027987c79613784b34c122e9..12a2f5ff5c3a797d70fafc33e09b6b51f7ea81d0 100644 (file)
@@ -61,9 +61,14 @@ class XendServers:
 
     def start(self):
         Vifctl.network('start')
+        threads = []
         for server in self.servers:
             thread = Thread(target=server.run)
             thread.start()
+            threads.append(thread)
+
+        for t in threads:
+            t.join()
 
 def create():
     root = SrvDir()